// components/RefundRecordItem/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    info:{
      type:Object
    }
  },
  data: {
    status:null
  },
  attached:function() {
    let tmp = this.transStatus(this.properties.info.type)
    this.setData({
      status: tmp
    })
  },
  methods: {
    transStatus(state) {
      const transMap = {
        1: { text: '未确认', color: "#999999" },
        2: { text: '执行中', color: "#FF6600" },
        3: { text: '已终止', color: "#999999" },
        4: { text: '已完成', color: "#08D608" },
      }
      return transMap[`${state}`]
    },
    ontap:function() {
      wx.navigateTo({
        url: `/pages/refundDetails/index?id=${this.properties.info.id}`,
      })
    }
  }
})
